import { createI18n } from 'vue-i18n'
import { getItem } from '@/utils/storage'
import { LANG } from '@/constant'
import zhCn from './lang/zh'
import en from './lang/en'
const message = {
  zh: {
    message: {
      ...zhCn
    }
  },
  en: {
    message: {
      ...en
    }
  }
}
const locale = getItem(LANG) ?? 'zh'
const i18n = createI18n({
  legacy: true,
  globalInjection: true,
  locale,
  messages: message
})
export default i18n
